
package com.hangxin.system.web;

import java.util.Calendar;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

import javax.annotation.Resource;
import javax.servlet.http.HttpServletRequest;

import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;

import com.hangxin.commons.util.DateUtil;
import com.hangxin.commons.util.PageModel;
import com.hangxin.commons.web.BasicAction;
import com.hangxin.system.dto.LogList;
import com.hangxin.system.service.SyslogService;
import com.hangxin.system.util.LogContent;


@Controller
public class SyslogAction extends BasicAction
{
	@Resource
	private SyslogService syslogServiceImpl;	
	
	@RequestMapping(value = "/syslogAction")
	public String syslogAction(HttpServletRequest request, Integer pageno, Integer pages,
			Integer pageSize, String beginDate, String endDate,
			String cont, Model model)
	{
		
		

		PageModel<Map<String, Object>> pageModel = new PageModel<Map<String, Object>>();
		pages = pages == null ? 1 : pages;
		pageno = pageno == null ? 1 : pageno;
		pageSize = pageSize == null ? 20 : pageSize;
		pageModel.setPages(pages);// 必须先比pageno设置
		pageModel.setPageNo(pageno);
		pageModel.setPageSize(pageSize);
		model.addAttribute("cont", cont);
		cont = cont == null ? "%"+"%" : "%"+cont+"%" ;
		
		pageModel = syslogServiceImpl.searchLog(pageModel, cont);
			
		model.addAttribute("pageModel", pageModel);
		
		

		
		return "system/syslog/syslog";
	}

}
